package cl.alto.soap;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

import cl.alto.clases.Isapre;
import cl.alto.dao.*;


public class Isapres implements Serializable {
	
	private static final long serialVersionUID = 1L;
	private Map<String,String> isapres = new HashMap<String, String>();

	public Isapres(){
		//isapres.put("Colmena", "Colmena");
		//isapres.put("Fonasa", "Fonasa");
		try {
			List<Isapre> listaIsapres = DaoCombos.getIsapres();
			Iterator<Isapre> iterator = listaIsapres.iterator();
			//System.out.println("--- iterator: "+iterator.toString());
			while (iterator.hasNext()) {
				Isapre isaprita = iterator.next();
				//System.out.println("--- isaprita: "+isaprita.getNombre());
				isapres.put(isaprita.getNombre(), String.valueOf(isaprita.getId()));
			}
		} catch (Exception e) {
			// TODO: handle exception
		}
		
	}
	
	public Map<String, String> getIsapres() {
		return isapres;
	}
}


